﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SectionDownloadEdit.ascx.cs" Inherits="ExaminationSys.View.Section.SectionDownloadEdit" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script type="text/javascript" language="javascript">
    var setID = function (param, sectionId) {
        try {

            var hidden = document.getElementById('<%=IDHidden.ClientID %>');
            hidden.value = param;

            var shidden = document.getElementById('<%=HidSectionID.ClientID %>');
            shidden.value = sectionId;
        } catch (e) {
            alert(e);
        }
    };

    var setSectionID = function (param) {
        try {

            var hidden = document.getElementById('<%=HidSectionID.ClientID %>');
            hidden.value = param;
        } catch (e) {
            alert(e);
        }
    };
</script>
<input type="hidden" id="IDHidden" runat="server" />
<input type="hidden" id="HidSectionID" runat="server" />

<ext:Window ID="SectionDownloadEditWindow" runat="server" Icon="Group" Title="下载文件上传" Width="300"
    Height="386" AutoShow="false" Modal="true" Hidden="true" Layout="Fit">
    <Items>
        <ext:FormPanel ID="SectionDownloadEditPanel" runat="server" Icon="ChartOrganisation"
            DefaultAnchor="95%" Padding="5" BodyPadding="10">
            <Items>
                <ext:TextField ID="Title" AllowBlank="false" runat="server" FieldLabel="标题" />
                  <ext:FileUploadField Id="fileUpload" AllowBlank="true" runat ="server" 
                    EmptyText="请选择文件"
                    FieldLabel="附件"
                    Icon="ImageAdd"
                    ButtonText="浏览"
                    Regex="^.+\.((jpg)|(jpeg)|(gif)|(doc)|(docx)|(pdf)|(xls)|(txt)|(rar)|(zip))$"
                    RegexText="文件格式不正确，建议后缀名(jpg)|(jpeg)|(gif)(doc)|(docx)|(pdf)|(xls)|(txt)|(rar)|(zip)">
                </ext:FileUploadField>
               <%-- <ext:TextField ID="AttachFile" AllowBlank="true" runat="server" FieldLabel="文件名" />--%>
                <ext:NumberField ID="OrderIndex" runat="server" FieldLabel="排序"  />
                <ext:LinkButton ID="reUploadBtn" runat="server" Visible="false" Text="重新上传">
                    <DirectEvents>
                        <Click OnEvent="reUploadBtn_Click" />
                     </DirectEvents>
                </ext:LinkButton>
                 <ext:TextField ID="Description" AllowBlank="true" runat="server" FieldLabel="备注" />
                
              
            </Items>
        </ext:FormPanel>
    </Items>
    <Buttons>
        <ext:Button ID="SaveButton" runat="server" Text="保存" Icon="BulletGo">
            <DirectEvents>
                <Click OnEvent="SaveSectionDownload" Failure="Ext.MessageBox.alert('Saving failed', 'Error during ajax event');" Success="#{StoreSectionDownload}.reload();">
                </Click>
            </DirectEvents>
        </ext:Button>
        <ext:Button ID="CancelButton" runat="server" Text="取消" Icon="Cancel">
            <Listeners>
                <Click Handler="#{SectionDownloadEditWindow}.hide(null);" />
            </Listeners>
        </ext:Button>
    </Buttons>
</ext:Window>
